package com.mtsmda.webServices.rpcStyle.first.client;

import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

import com.mtsmda.webServices.rpcStyle.first.WServiceRPCStyleI;

public class WServicePRPCStyleClient {

	public static void main(String[] args) {
		try {
			URL wsdlUrl = new URL(
					"http://localhost:8888/webseriveRPC/hello?wsdl");

			// 1 param from wsdl file "targetNamespace"
			// 2 param "service @namename"
			QName qName = new QName(
					"http://first.rpcStyle.webServices.mtsmda.com/",
					"WServiceRPCStyleImplService");

			Service service = Service.create(wsdlUrl, qName);

			WServiceRPCStyleI wServiceRPCStyleI = service
					.getPort(WServiceRPCStyleI.class);
			System.out.println(wServiceRPCStyleI.getHello("Dmitrii"));

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}